/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.mzk.oai.metadataRepository.cli;

import cz.mzk.kramerius.commons.PropertyLoader;
import cz.mzk.oai.metadataRepository.repository.Repository;
import java.io.File;
import java.util.Properties;

/**
 *
 * @author Martin Řehánek (rehan at mzk.cz)
 */
public abstract class AbstractHarvestTeiAction extends Action {

    private static final String PROP_TEI_SVN_URL = "repositoryManager.harvest.tei.svn.url";
    private static final String PROP_TEI_SVN_MAPPING_FILE = "repositoryManager.harvest.tei.sysnoSignature.mappingFile";
    protected String url;
    protected File mappingFile;

    public AbstractHarvestTeiAction(Repository repository, Properties properties) {
        super(repository);
        loadProperties(properties);
    }

    private void loadProperties(Properties properties) {
        PropertyLoader loader = new PropertyLoader(properties);
        url = loader.loadString(PROP_TEI_SVN_URL);
        mappingFile = loader.loadFile(PROP_TEI_SVN_MAPPING_FILE, true, true, false);
    }

    public abstract void run() throws Exception;
}
